<template>
    <el-row style="text-align: left; border: 1px solid #eee">
        <el-row style="margin: 20px">系统配置</el-row>
        <el-row>
            <span style="margin: 20px">控制器： </span>
            <el-radio-group @change="postConfig" v-model="controller">
                <el-radio :label="1">ONOS</el-radio>
                <el-radio :label="2">OpenDaylight</el-radio>
                <el-radio :label="3">Floodlight</el-radio>
                <el-radio :label="4">Ryu</el-radio>
                <el-radio :label="5">Pox</el-radio>
            </el-radio-group>
        </el-row>
        <el-row style="margin: 20px">
            <span style="margin-right: 20px">控制器端口号： </span>
            <el-radio-group @change="postConfig" v-model="port">
                <el-radio :label="6633">6633</el-radio>
                <el-radio :label="6653">6653</el-radio>
            </el-radio-group>
        </el-row>
        <el-row style="margin: 20px">
            <span style="margin-right: 20px">OpenFlow版本： </span>
            <el-radio-group @change="postConfig" v-model="version">
                <el-radio :label="10">OpenFLow1.0</el-radio>
                <el-radio :label="13">OpenFLow1.3</el-radio>
            </el-radio-group>
        </el-row>
    </el-row>
</template>

<script>
    import axios from 'axios'
    export default {
        name: "Config",
        data () {
            return {
                controller: 1,
                version: 13,
                port: 6653
            };
        },
        methods: {
            postConfig(){
                axios({
                    method: 'post',
                    url: '/config',
                    data: {
                        controller: this.controller,
                        version: this.version,
                        port: this.port,
                    }
                }).catch(err => {
                    alert(err)
                })
            }
        }
    }
</script>

<style scoped>

</style>